﻿using HelpDeskTool.Entities;

namespace HelpDeskTool.Services;

/// <summary>
/// Updating computer information service
/// </summary>
public interface IUpdater
{
	/// <summary>
	/// Task was completed
	/// </summary>
	event EventHandler? InformationChanged;

	/// <summary>
	/// Computer Information in collection was updated
	/// </summary>
	event EventHandler? UpdateEnded;

	Task StartAsync(ICollection<IComputer> computers, TimeSpan period, CancellationToken cancellationToken = default);

	/// <summary>
	/// Get computer information through WMI
	/// </summary>
	/// <returns></returns>
	Task<DetailInfo> GetInformationAsync(string hostname, CancellationToken cancellationToken = default);
}
